//
//  GoOutAcePackDetailModel.m
//  ArtOfLiving
//
//  Created by 刘虎 on 16/5/3.
//  Copyright © 2016年 刘虎. All rights reserved.
//

#import "GoOutAcePackDetailModel.h"

@implementation GoOutAcePackDetailModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"authors"]) {
        
        NSArray *arr = value;
        if (arr.count != 0) {
            
            [self.authorsModel setValuesForKeysWithDictionary:arr.firstObject];
        }
    }
    
    if ([key isEqualToString:@"id"]) {
        
        self.ID = value;
    }
    if ([key isEqualToString:@"related_guides"]) {
        
        for (NSDictionary *dic in value) {
            
            GoOutAcePackTopicModel *model = [[GoOutAcePackTopicModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [self.related_guidesMArr addObject:model];
        }
    }
}

- (NSMutableArray *)related_guidesMArr {
    
    if (!_related_guidesMArr) {
        
        _related_guidesMArr = [[NSMutableArray alloc] init];
    }
    return _related_guidesMArr;
}

- (GoOutAuthorsModel *)authorsModel {
    
    if (!_authorsModel) {
        
        _authorsModel = [[GoOutAuthorsModel alloc] init];
    }
    return _authorsModel;
}

@end
